<!--#include file="ajax/conn.asp"#-->

<%
Function GetBinaryFile(ByVal FileSpec)
	Const adTypeBinary = 1
	Dim objStream
	Set objStream = Server.CreateObject("ADODB.Stream")
		objStream.Open()
		objStream.Type = adTypeBinary
		objStream.LoadFromFile (FileSpec)
		GetBinaryFile = objStream.Read()
	Set objStream = Nothing
End Function

Select Case request("do")
	Case "setLeitura"
		setLeitura()
End Select

Sub setLeitura()
	Dim sql, FullFileName
	if request("cod_envio_informativo") <> "" THEN
		sql = "EXEC informativos.sp_tracker "&request("cod_envio_informativo")
		executeQuery(sql)
	end if
	'response.write("<img src=""imgs/1px.gif"">")
		
	FullFileName = server.MapPath("/imgs/")&"\1px.gif"
	
	response.Buffer = true
	Response.ContentType = "image/gif"
	'Response.Addheader "Content-Disposition", "attachment; filename=" & "1px.gif"
	Response.Binarywrite GetBinaryFile( FullFileName )
	
End Sub
%>